package com.chenjinyan.service;

import com.alibaba.fastjson.JSONObject;
import com.chenjinyan.entity.GoodsEntity;
import com.chenjinyan.entity.MessageEntity;
import com.chenjinyan.entity.PicUrlEntity;
import com.chenjinyan.entity.UserEntity;
import com.chenjinyan.vo.AnswerVo;
import com.chenjinyan.vo.GoodsInfoVo;

import java.util.List;

/**
 * @author chenjinyan
 * @version 1.0
 */
public interface GoodsService {

    Long saveGoodsInfo(GoodsEntity goodsEntity);

    UserEntity getUserIdByUsername(String userName);

    List<GoodsEntity> findById(Long id);

    void savePicUrl(PicUrlEntity picUrlEntity);

    JSONObject getGoodsInfo(GoodsInfoVo goodsInfoVo);

    JSONObject delGoodsInfo(String path, List<String> goodsIds);

    JSONObject getMessages(String goodsId,String pageNo,String pageSize);

    /**
     * 查询所有省
     *
     * @return
     */
    String findAllProvince();

    /**
     * 根据省代码查询相关的市区
     *
     * @param provinceId
     * @return
     */
    String findCityByProvince(int provinceId);

    /**
     * 根据市代码查询相关行政区域
     *
     * @return
     */
    String findAreaByCity(int cityId);

    /**
     * 回答问题
     *
     * @return
     */
    JSONObject answerQuestion(AnswerVo answerVo);

    /**
     * 查看问题
     *
     * @return
     */
    JSONObject getQuestion(Long goodId);

    /**
     * 留言
     *
     */
    void leaveMessage(MessageEntity messageEntity);


}
